package com.java.singleton;

import java.io.IOException;
import java.util.Properties;

/**
 * @author jingjintao
 * @date 2021/10/29 - 21:19
 **/
public class Singleton3 {
    private Singleton3(String info){
        this.info = info;
    }

    public static  Singleton3 INSTANCE;

    private String info;

    static {
        Properties properties = new Properties();
        try {
            properties.load(Singleton3.class.getClassLoader().getResourceAsStream("info.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        INSTANCE = new Singleton3(properties.getProperty("info"));
    }
    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    @Override
    public String toString() {
        return "Singleton3{" +
                "info='" + info + '\'' +
                '}';
    }
}
